<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: include/http.hpp 源文件</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">http.hpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d4/d51/http_8hpp.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="preprocessor">#ifndef HTTP_HPP</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#define HTTP_HPP</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#include &lt;atomic&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="preprocessor">#include &lt;curl/curl.h&gt;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../df/d8d/namespacewheels.html">wheels</a></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span>{</div>
<div class="foldopen" id="foldopen00016" data-start="{" data-end="};">
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"><a class="line" href="../../d2/d49/classwheels_1_1http.html">   16</a></span><span class="keyword">class </span><a class="code hl_class" href="../../d2/d49/classwheels_1_1http.html">http</a></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span>{</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span>    <span class="keyword">friend</span> <span class="keywordtype">size_t</span> <a class="code hl_friend" href="../../d2/d49/classwheels_1_1http.html#a9b61d4f08b77bd35e29c7f0d3795a1c6">http_write_callback</a>(<span class="keywordtype">char</span> *ptr, <span class="keywordtype">size_t</span> size, <span class="keywordtype">size_t</span> nmemb, <span class="keywordtype">void</span> *obj );</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="keyword">public</span>:</div>
<div class="foldopen" id="foldopen00020" data-start="{" data-end="};">
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="../../d2/d49/classwheels_1_1http.html#aaba924b6a216bae9964fd7ec76a0de2a">   20</a></span>    <span class="keyword">enum</span> <a class="code hl_enumeration" href="../../d2/d49/classwheels_1_1http.html#aaba924b6a216bae9964fd7ec76a0de2a">emErrCode</a>{</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="../../d2/d49/classwheels_1_1http.html#aaba924b6a216bae9964fd7ec76a0de2aa384890afe603860db66d75fc9c62c5f6">   21</a></span>        <a class="code hl_enumvalue" href="../../d2/d49/classwheels_1_1http.html#aaba924b6a216bae9964fd7ec76a0de2aa384890afe603860db66d75fc9c62c5f6">ERR_ALLOC_MEM</a> = -1000,</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="../../d2/d49/classwheels_1_1http.html#aaba924b6a216bae9964fd7ec76a0de2aad9b91fd691b88b36b805e21ac35e803a">   22</a></span>        <a class="code hl_enumvalue" href="../../d2/d49/classwheels_1_1http.html#aaba924b6a216bae9964fd7ec76a0de2aad9b91fd691b88b36b805e21ac35e803a">ERR_INIT</a>,</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span>        <a class="code hl_enumvalue" href="../../d2/d49/classwheels_1_1http.html#aaba924b6a216bae9964fd7ec76a0de2aa11110903cf2df41f38e0b0f782862ff3">OK</a> = 0</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="../../d2/d49/classwheels_1_1http.html#aaba924b6a216bae9964fd7ec76a0de2aa11110903cf2df41f38e0b0f782862ff3">   24</a></span>    };</div>
</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="../../d2/d49/classwheels_1_1http.html#a1be223557efa4f20d924411f8b39c610ac5e323844215a47a24499f1bcb75fe72">   25</a></span>     <span class="keyword">enum</span> <a class="code hl_enumeration" href="../../d2/d49/classwheels_1_1http.html#a1be223557efa4f20d924411f8b39c610">mtd</a>{ <a class="code hl_enumvalue" href="../../d2/d49/classwheels_1_1http.html#a1be223557efa4f20d924411f8b39c610ac5e323844215a47a24499f1bcb75fe72">GET</a> , <a class="code hl_enumvalue" href="../../d2/d49/classwheels_1_1http.html#a1be223557efa4f20d924411f8b39c610a91fc9e0ae9d3b79d9a2c14c3c3a9d401">POST</a> };</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span>    std::string         m_server;           <span class="comment">// 服务器</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span>    std::string         m_url;              <span class="comment">// URL</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span>    std::string         m_head;             <span class="comment">// 头信息</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span>    std::string         m_cert;             <span class="comment">// 客户端数字证书路径</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span>    std::string         m_caPath;           <span class="comment">// 用来验证服务器的CA</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span>    <a class="code hl_enumeration" href="../../d2/d49/classwheels_1_1http.html#a1be223557efa4f20d924411f8b39c610">mtd</a>                 m_mtd;              <span class="comment">// 数据提交方法</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span> </div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span>    <span class="keywordtype">int</span>                 m_port;             <span class="comment">// 连接端口</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span>    <span class="keywordtype">bool</span>                m_https;            <span class="comment">// https</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span>    <span class="keywordtype">bool</span>                m_keepalive;        <span class="comment">// http keepalive</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span> </div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span>    <span class="keywordtype">int</span>                 m_respond_overtime; <span class="comment">// 操作超时时间</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span>    CURL                * ptctx;            <span class="comment">// 使用CURL 作为HTTP后台操作的协议层引擎。</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span>    <span class="keyword">struct </span>curl_slist   * ptHeaders;        <span class="comment">// HTTP头信息结构</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span> </div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>    std::function&lt; void ( <span class="keyword">const</span> <span class="keywordtype">char</span> * rst , <span class="keywordtype">size_t</span> len ) &gt;  __m_cb;</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span> </div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>    <span class="keyword">explicit</span> <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#ac205a9806c29a007d236f10424b59a36">http</a>( <span class="keywordtype">int</span> overtime = 180 );</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span>    <span class="keyword">virtual</span> <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a5d080778775ecab2c4eb9c185b192b57">~http</a>();</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span>    <a class="code hl_class" href="../../d2/d49/classwheels_1_1http.html">http</a>&amp; <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#ad4b3f7c9e9ab8062de75294af8b0e8c5">server</a>( <span class="keyword">const</span> std::string&amp; svr  );</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"><a class="line" href="../../d2/d49/classwheels_1_1http.html#aba058da78ed66460e8734b623645aae1">   54</a></span>    <span class="keyword">const</span> std::string <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#aba058da78ed66460e8734b623645aae1">server</a>( <span class="keywordtype">int</span> &amp;<a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a0611b602ae558f28043f424db17a9850">port</a> )<span class="keyword">const</span>;</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="../../d2/d49/classwheels_1_1http.html#af57be44397aae928cc4d15801a0ff84c">   55</a></span>    <a class="code hl_class" href="../../d2/d49/classwheels_1_1http.html">http</a>&amp; <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#af57be44397aae928cc4d15801a0ff84c">server</a>( <span class="keyword">const</span> std::string&amp; svr , <span class="keywordtype">int</span> <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a0611b602ae558f28043f424db17a9850">port</a> );</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span>    <a class="code hl_class" href="../../d2/d49/classwheels_1_1http.html">http</a>&amp; <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a86fe82d1ec49e68f1a96297de358beaf">url</a>( <span class="keyword">const</span> std::string&amp; <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a86fe82d1ec49e68f1a96297de358beaf">url</a>  );</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="../../d2/d49/classwheels_1_1http.html#a86fe82d1ec49e68f1a96297de358beaf">   61</a></span>    <span class="keyword">const</span> std::string <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a86fe82d1ec49e68f1a96297de358beaf">url</a>( ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span>    <a class="code hl_class" href="../../d2/d49/classwheels_1_1http.html">http</a>&amp; <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a22f10182a306a3ec6802be31638dd5e9">head</a>  ( <span class="keyword">const</span> std::string&amp; <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a22f10182a306a3ec6802be31638dd5e9">head</a> );</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="../../d2/d49/classwheels_1_1http.html#a22f10182a306a3ec6802be31638dd5e9">   69</a></span>    <span class="keyword">const</span> std::string <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a22f10182a306a3ec6802be31638dd5e9">head</a>( ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span>    <a class="code hl_class" href="../../d2/d49/classwheels_1_1http.html">http</a>&amp; <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a892f673aee43e58ffaebb8b1e47de261">cert</a>  ( <span class="keyword">const</span> std::string&amp; <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a892f673aee43e58ffaebb8b1e47de261">cert</a> );</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"><a class="line" href="../../d2/d49/classwheels_1_1http.html#a892f673aee43e58ffaebb8b1e47de261">   74</a></span>    <span class="keyword">const</span> std::string <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a892f673aee43e58ffaebb8b1e47de261">cert</a>()<span class="keyword">const</span>;</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>    <a class="code hl_class" href="../../d2/d49/classwheels_1_1http.html">http</a>&amp; <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a03252826449619859e36ef4256e486df">ssl</a>( <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a03252826449619859e36ef4256e486df">ssl</a> );</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"><a class="line" href="../../d2/d49/classwheels_1_1http.html#a03252826449619859e36ef4256e486df">   81</a></span>    <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a03252826449619859e36ef4256e486df">ssl</a>()<span class="keyword">const</span>;</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span>    <a class="code hl_class" href="../../d2/d49/classwheels_1_1http.html">http</a>&amp; <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a0611b602ae558f28043f424db17a9850">port</a>( <span class="keywordtype">int</span> <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a0611b602ae558f28043f424db17a9850">port</a> );</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"><a class="line" href="../../d2/d49/classwheels_1_1http.html#a0611b602ae558f28043f424db17a9850">   85</a></span>    <span class="keywordtype">int</span> <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a0611b602ae558f28043f424db17a9850">port</a>()<span class="keyword">const</span>;</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>    <a class="code hl_class" href="../../d2/d49/classwheels_1_1http.html">http</a>&amp; <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#aafc8bf0858c48a2540aa27ebaf5e0559">keepalive</a>( <span class="keywordtype">bool</span> keep );</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"><a class="line" href="../../d2/d49/classwheels_1_1http.html#aafc8bf0858c48a2540aa27ebaf5e0559">   89</a></span>    <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#aafc8bf0858c48a2540aa27ebaf5e0559">keepalive</a>()<span class="keyword">const</span>;</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span>    <span class="keywordtype">int</span> <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a96291582f8e63359b0a78a451b085799">get</a>( <span class="keyword">const</span> std::string&amp; query , std::function&lt; <span class="keywordtype">void</span> ( <span class="keyword">const</span> <span class="keywordtype">char</span> * rst , <span class="keywordtype">size_t</span> len ) &gt; fun );</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span>    <span class="keywordtype">int</span> <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a9d5ec6326e0bf8e3cd9c45cef9533981">post</a>( <span class="keyword">const</span> std::string&amp; query , std::function&lt; <span class="keywordtype">void</span> ( <span class="keyword">const</span> <span class="keywordtype">char</span> * rst , <span class="keywordtype">size_t</span> len ) &gt; fun );</div>
<div class="foldopen" id="foldopen00108" data-start="{" data-end="}">
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"><a class="line" href="../../d2/d49/classwheels_1_1http.html#af98bc267123ee733d2a86c204e826a77">  108</a></span>    <span class="keyword">inline</span> <a class="code hl_class" href="../../d2/d49/classwheels_1_1http.html">http</a>&amp; <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#af98bc267123ee733d2a86c204e826a77">timeOut</a>( <span class="keywordtype">long</span> t )</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno">  109</span>    {</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno">  110</span>        m_respond_overtime = t;</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno">  111</span>        <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno">  112</span>    }</div>
</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"><a class="line" href="../../d2/d49/classwheels_1_1http.html#ad8a7fd654762470b52c9bd96f33c6308">  117</a></span>    <span class="keyword">inline</span> <span class="keywordtype">long</span> <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#ad8a7fd654762470b52c9bd96f33c6308">timeOut</a>(){ <span class="keywordflow">return</span> m_respond_overtime; }</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="../../d2/d49/classwheels_1_1http.html#a3b3f3598fab39ce7ba77debed620e67f">__on_recv</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> *ptr, <span class="keywordtype">size_t</span> size );</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span> </div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno">  125</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno">  128</span>    <span class="keywordtype">int</span> do_post( <span class="keyword">const</span> <span class="keywordtype">char</span> * data );</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno">  129</span>    <span class="keywordtype">int</span> do_post( <span class="keyword">const</span> std::string&amp; data );</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno">  132</span>    <span class="keywordtype">int</span> do_get( <span class="keyword">const</span> <span class="keywordtype">char</span>* data );</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno">  133</span>    <span class="keywordtype">int</span> do_get( <span class="keyword">const</span> std::string&amp; data );</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno">  137</span>    <span class="keywordtype">int</span> init_headers();</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span>    <span class="keywordtype">void</span> init_header_struct();</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno">  150</span>    <span class="keywordtype">size_t</span> find_line_pos( <span class="keyword">const</span> std::string&amp; str , <span class="keywordtype">size_t</span> &amp;line_width );</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno">  151</span>};</div>
</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno">  152</span>}</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno">  153</span><span class="preprocessor">#endif </span><span class="comment">// HTTP_HPP</span></div>
<div class="ttc" id="aclasswheels_1_1http_html"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html">wheels::http</a></div><div class="ttdef"><b>定义</b> <a href="#l00016">http.hpp:17</a></div></div>
<div class="ttc" id="aclasswheels_1_1http_html_a03252826449619859e36ef4256e486df"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#a03252826449619859e36ef4256e486df">wheels::http::ssl</a></div><div class="ttdeci">bool ssl() const</div></div>
<div class="ttc" id="aclasswheels_1_1http_html_a0611b602ae558f28043f424db17a9850"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#a0611b602ae558f28043f424db17a9850">wheels::http::port</a></div><div class="ttdeci">int port() const</div></div>
<div class="ttc" id="aclasswheels_1_1http_html_a1be223557efa4f20d924411f8b39c610"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#a1be223557efa4f20d924411f8b39c610">wheels::http::mtd</a></div><div class="ttdeci">mtd</div><div class="ttdef"><b>定义</b> <a href="#l00025">http.hpp:25</a></div></div>
<div class="ttc" id="aclasswheels_1_1http_html_a1be223557efa4f20d924411f8b39c610a91fc9e0ae9d3b79d9a2c14c3c3a9d401"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#a1be223557efa4f20d924411f8b39c610a91fc9e0ae9d3b79d9a2c14c3c3a9d401">wheels::http::POST</a></div><div class="ttdeci">@ POST</div><div class="ttdef"><b>定义</b> <a href="#l00025">http.hpp:25</a></div></div>
<div class="ttc" id="aclasswheels_1_1http_html_a1be223557efa4f20d924411f8b39c610ac5e323844215a47a24499f1bcb75fe72"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#a1be223557efa4f20d924411f8b39c610ac5e323844215a47a24499f1bcb75fe72">wheels::http::GET</a></div><div class="ttdeci">@ GET</div><div class="ttdef"><b>定义</b> <a href="#l00025">http.hpp:25</a></div></div>
<div class="ttc" id="aclasswheels_1_1http_html_a22f10182a306a3ec6802be31638dd5e9"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#a22f10182a306a3ec6802be31638dd5e9">wheels::http::head</a></div><div class="ttdeci">const std::string head() const</div></div>
<div class="ttc" id="aclasswheels_1_1http_html_a3b3f3598fab39ce7ba77debed620e67f"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#a3b3f3598fab39ce7ba77debed620e67f">wheels::http::__on_recv</a></div><div class="ttdeci">void __on_recv(const char *ptr, size_t size)</div><div class="ttdoc">__on_recv</div><div class="ttdef"><b>定义</b> <a href="../../d2/d03/http_8cpp_source.html#l00052">http.cpp:52</a></div></div>
<div class="ttc" id="aclasswheels_1_1http_html_a5d080778775ecab2c4eb9c185b192b57"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#a5d080778775ecab2c4eb9c185b192b57">wheels::http::~http</a></div><div class="ttdeci">virtual ~http()</div><div class="ttdef"><b>定义</b> <a href="../../d2/d03/http_8cpp_source.html#l00040">http.cpp:40</a></div></div>
<div class="ttc" id="aclasswheels_1_1http_html_a86fe82d1ec49e68f1a96297de358beaf"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#a86fe82d1ec49e68f1a96297de358beaf">wheels::http::url</a></div><div class="ttdeci">const std::string url() const</div></div>
<div class="ttc" id="aclasswheels_1_1http_html_a892f673aee43e58ffaebb8b1e47de261"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#a892f673aee43e58ffaebb8b1e47de261">wheels::http::cert</a></div><div class="ttdeci">const std::string cert() const</div></div>
<div class="ttc" id="aclasswheels_1_1http_html_a96291582f8e63359b0a78a451b085799"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#a96291582f8e63359b0a78a451b085799">wheels::http::get</a></div><div class="ttdeci">int get(const std::string &amp;query, std::function&lt; void(const char *rst, size_t len) &gt; fun)</div><div class="ttdoc">get</div><div class="ttdef"><b>定义</b> <a href="../../d2/d03/http_8cpp_source.html#l00222">http.cpp:222</a></div></div>
<div class="ttc" id="aclasswheels_1_1http_html_a9b61d4f08b77bd35e29c7f0d3795a1c6"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#a9b61d4f08b77bd35e29c7f0d3795a1c6">wheels::http::http_write_callback</a></div><div class="ttdeci">friend size_t http_write_callback(char *ptr, size_t size, size_t nmemb, void *obj)</div><div class="ttdef"><b>定义</b> <a href="../../d2/d03/http_8cpp_source.html#l00010">http.cpp:10</a></div></div>
<div class="ttc" id="aclasswheels_1_1http_html_a9d5ec6326e0bf8e3cd9c45cef9533981"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#a9d5ec6326e0bf8e3cd9c45cef9533981">wheels::http::post</a></div><div class="ttdeci">int post(const std::string &amp;query, std::function&lt; void(const char *rst, size_t len) &gt; fun)</div><div class="ttdoc">post</div><div class="ttdef"><b>定义</b> <a href="../../d2/d03/http_8cpp_source.html#l00230">http.cpp:230</a></div></div>
<div class="ttc" id="aclasswheels_1_1http_html_aaba924b6a216bae9964fd7ec76a0de2a"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#aaba924b6a216bae9964fd7ec76a0de2a">wheels::http::emErrCode</a></div><div class="ttdeci">emErrCode</div><div class="ttdef"><b>定义</b> <a href="#l00020">http.hpp:20</a></div></div>
<div class="ttc" id="aclasswheels_1_1http_html_aaba924b6a216bae9964fd7ec76a0de2aa11110903cf2df41f38e0b0f782862ff3"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#aaba924b6a216bae9964fd7ec76a0de2aa11110903cf2df41f38e0b0f782862ff3">wheels::http::OK</a></div><div class="ttdeci">@ OK</div><div class="ttdef"><b>定义</b> <a href="#l00024">http.hpp:23</a></div></div>
<div class="ttc" id="aclasswheels_1_1http_html_aaba924b6a216bae9964fd7ec76a0de2aa384890afe603860db66d75fc9c62c5f6"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#aaba924b6a216bae9964fd7ec76a0de2aa384890afe603860db66d75fc9c62c5f6">wheels::http::ERR_ALLOC_MEM</a></div><div class="ttdeci">@ ERR_ALLOC_MEM</div><div class="ttdef"><b>定义</b> <a href="#l00021">http.hpp:21</a></div></div>
<div class="ttc" id="aclasswheels_1_1http_html_aaba924b6a216bae9964fd7ec76a0de2aad9b91fd691b88b36b805e21ac35e803a"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#aaba924b6a216bae9964fd7ec76a0de2aad9b91fd691b88b36b805e21ac35e803a">wheels::http::ERR_INIT</a></div><div class="ttdeci">@ ERR_INIT</div><div class="ttdef"><b>定义</b> <a href="#l00022">http.hpp:22</a></div></div>
<div class="ttc" id="aclasswheels_1_1http_html_aafc8bf0858c48a2540aa27ebaf5e0559"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#aafc8bf0858c48a2540aa27ebaf5e0559">wheels::http::keepalive</a></div><div class="ttdeci">bool keepalive() const</div></div>
<div class="ttc" id="aclasswheels_1_1http_html_aba058da78ed66460e8734b623645aae1"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#aba058da78ed66460e8734b623645aae1">wheels::http::server</a></div><div class="ttdeci">const std::string server(int &amp;port) const</div></div>
<div class="ttc" id="aclasswheels_1_1http_html_ac205a9806c29a007d236f10424b59a36"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#ac205a9806c29a007d236f10424b59a36">wheels::http::http</a></div><div class="ttdeci">http(int overtime=180)</div><div class="ttdef"><b>定义</b> <a href="../../d2/d03/http_8cpp_source.html#l00024">http.cpp:24</a></div></div>
<div class="ttc" id="aclasswheels_1_1http_html_ad4b3f7c9e9ab8062de75294af8b0e8c5"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#ad4b3f7c9e9ab8062de75294af8b0e8c5">wheels::http::server</a></div><div class="ttdeci">http &amp; server(const std::string &amp;svr)</div><div class="ttdoc">设置服务器地址，这个地址可以是域名也可以是IP地址</div><div class="ttdef"><b>定义</b> <a href="../../d2/d03/http_8cpp_source.html#l00060">http.cpp:60</a></div></div>
<div class="ttc" id="aclasswheels_1_1http_html_ad8a7fd654762470b52c9bd96f33c6308"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#ad8a7fd654762470b52c9bd96f33c6308">wheels::http::timeOut</a></div><div class="ttdeci">long timeOut()</div><div class="ttdoc">获取当前的超时时间</div><div class="ttdef"><b>定义</b> <a href="#l00117">http.hpp:117</a></div></div>
<div class="ttc" id="aclasswheels_1_1http_html_af57be44397aae928cc4d15801a0ff84c"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#af57be44397aae928cc4d15801a0ff84c">wheels::http::server</a></div><div class="ttdeci">http &amp; server(const std::string &amp;svr, int port)</div></div>
<div class="ttc" id="aclasswheels_1_1http_html_af98bc267123ee733d2a86c204e826a77"><div class="ttname"><a href="../../d2/d49/classwheels_1_1http.html#af98bc267123ee733d2a86c204e826a77">wheels::http::timeOut</a></div><div class="ttdeci">http &amp; timeOut(long t)</div><div class="ttdoc">配置通讯超时时间，单位为s.在默认的情况下超时时间为10s</div><div class="ttdef"><b>定义</b> <a href="#l00108">http.hpp:108</a></div></div>
<div class="ttc" id="anamespacewheels_html"><div class="ttname"><a href="../../df/d8d/namespacewheels.html">wheels</a></div><div class="ttdoc">堆栈信息读取和保存记录</div><div class="ttdef"><b>定义</b> <a href="../../d3/df7/ary__str_8hpp_source.html#l00006">ary_str.hpp:7</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
